<template>
  <div class="linear-card">
    <div v-show="title" class="linear-card-title">{{ title }}</div>
    <div class="linear-card-content">
      <slot />
    </div>
  </div>
</template>

<script>
export default {
  name: "LinearCard",
  props: {
    title: {
      type: String,
      default: "",
    },
  },
};
</script>

<style lang="less" scoped>
.linear-card {
  height: 100%;
  overflow-y: hidden;
  padding: 8px 10px;
  box-sizing: border-box;
  background-color: #fff;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  color: #ebdfdfe0;
  background-image: linear-gradient(
    180deg,
    #bf0000 0%,
    #e0b5b570 25%,
    transparent 70%,
    transparent 100%
  );
  &-title {
    position: relative;
    padding-left: 10px;
    color: #fff;
    font-weight: bold;
    text-align: left;
    &::before {
      content: "";
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      display: block;
      width: 4px;
      height: 15px;
      background-color: #fff;
    }
  }
  &-content {
    flex: 1;
  }
}
</style>
